#ifndef __MEBSP_DEVCOM_OUT_H
#define __MEBSP_DEVCOM_OUT_H 			   
  
#include "at32f403a_407.h"
#include <stdint.h>

enum {
	MB_DEVCOM_OUT_LINE_SEND_IDLE 					= 0, 
	MB_DEVCOM_OUT_LINE_SEND_START,
  MB_DEVCOM_OUT_LINE_SEND_NORMAL,
};

enum {
	MB_DEVCOM_OUT_LINE_RECV_IDLE 					= 0, 
	MB_DEVCOM_OUT_LINE_RECV_ERR,
  MB_DEVCOM_OUT_LINE_RECV_NORMAL,
};


typedef struct
{
  uint8_t cTransmitlineState;

  uint8_t bRecvOKFlag;
  uint8_t bRecvIsConnFlag;
  uint8_t cRecvLineState;
  uint16_t wRecvLengthVal;
  uint16_t wRecvErrOutTimeCnt;
  
  uint16_t wTransmitCount;
  uint16_t wTransmitLength;
  uint8_t  *pTransmitBuff;
  uint16_t wTransmitDelayCnt;
  uint16_t wTransmitErrTimeCnt;
  
  
}_MB_DEVCOMOUT_T;

extern _MB_DEVCOMOUT_T MB_DevComOut;

extern void MeBsp_DevComOut_Init(void);
extern void MeBsp_DevComOut_Hanl(void);
extern void MeBsp_DevComOut_Send(void);
#endif





























